package com.harry.greendaomaster.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.harry.greendaomaster.db.JsonData;
import com.harry.greendaomaster.db.User;
import com.harry.greendaomaster.db.Work;

import com.harry.greendaomaster.greendao.gen.JsonDataDao;
import com.harry.greendaomaster.greendao.gen.UserDao;
import com.harry.greendaomaster.greendao.gen.WorkDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig jsonDataDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig workDaoConfig;

    private final JsonDataDao jsonDataDao;
    private final UserDao userDao;
    private final WorkDao workDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        jsonDataDaoConfig = daoConfigMap.get(JsonDataDao.class).clone();
        jsonDataDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        workDaoConfig = daoConfigMap.get(WorkDao.class).clone();
        workDaoConfig.initIdentityScope(type);

        jsonDataDao = new JsonDataDao(jsonDataDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        workDao = new WorkDao(workDaoConfig, this);

        registerDao(JsonData.class, jsonDataDao);
        registerDao(User.class, userDao);
        registerDao(Work.class, workDao);
    }
    
    public void clear() {
        jsonDataDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        workDaoConfig.clearIdentityScope();
    }

    public JsonDataDao getJsonDataDao() {
        return jsonDataDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public WorkDao getWorkDao() {
        return workDao;
    }

}
